import {get, post} from '/@/utils/http/axios';


enum URL {
    // create='/myapp/index/order/create',
    shoppinglist="shopping_list/",
    createOrder='shopping_create/',
    create='shopping_create/',
    cancelUserOrder = 'order/cancel/',
    userOrderList = 'order/list/',
    createpay='order_create/',
    pay_success='pay_success/'
}

const createApi = async (data: any) =>
    post<any>({url: URL.create, data: data, headers: {}});
const createPaySuccessApi = async (data: any) =>
    post<any>({url: URL.pay_success, data: data, headers: {}});
const createPayApi = async (params: any) =>
    post<any>({url: URL.createpay,params: params, data: {}, headers: {}});

const createOrderApi = async (data: any) =>
    post<any>({url: URL.createOrder, data: data, headers: {}});

const listShoppingCarApi = async (params: any) =>
    get<any>({url: URL.shoppinglist, params: params, data: {}, headers: {}});
const userOrderListApi = async (params: any) =>
    get<any>({url: URL.userOrderList, params: params, data: {}, headers: {}});

const cancelUserOrderApi = async (params: any) =>
    post<any>({url: URL.cancelUserOrder, params: params, headers: {}});

export {createPaySuccessApi,createPayApi,listShoppingCarApi,createOrderApi,createApi, userOrderListApi, cancelUserOrderApi};
